﻿using System;
using System.Runtime.InteropServices;

using WorkflowCommon = Scenario.WorkflowEngine.DataModel.Common;
using Scenario.WorkflowEngine.DataModel.WorkflowParticipantsData;

namespace Scenario.WAPI
{
    public partial class Role
    {
        [DllImport("WAPI.Dll", EntryPoint = "getRoles", CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        private static extern String GetRoles(ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "getRolesBykey", CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        private static extern String GetRolesByKey(String sRoleKey, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "createRole")]
        private static extern void CreateRole(String sRole, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "updateRole")]
        private static extern void UpdateRole(String sRole, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "deleteRole")]
        private static extern void DeleteRole(String sRoleKey, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "addUserToRole")]
        private static extern void AddUserToRole(String sUser, String sRoleKey, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "removeUserFromRole")]
        private static extern void RemoveUserFromRole(String User, String sRoleKey, ref Response response);

        [DllImport("WAPI.Dll", EntryPoint = "getRolesByUser", CharSet = CharSet.Ansi)]
        [return: MarshalAs(UnmanagedType.AnsiBStr)]
        private static extern String GetRolesByUser(String sUserKey, ref Response response);
    }
}
